package com.xjm.ips.service;


import com.xjm.ips.entity.Employeeremove;
import com.xjm.ips.entity.MyPage;
import com.xjm.ips.mapper.EmployeeremoveMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonnelRemoveService {
    @Autowired
    private EmployeeremoveMapper employeeremoveMapper;

    public MyPage getAllEmployeeRemoves(Integer pageNo, Integer pageSize) {
        if(pageNo!=null && pageSize!=null){
            pageNo = (pageNo-1)*pageSize;
        }
        MyPage myPage = new MyPage();
        myPage.setData(employeeremoveMapper.getAllEmployeeRemoves(pageNo,pageSize));
        myPage.setTotal(employeeremoveMapper.getTotal());
        return myPage;
    }

    public Integer deleteEmployeeRemoves(Integer id) {
        return employeeremoveMapper.deleteByPrimaryKey(id);
    }
}
